<?php $this->load->view('partial/head'); ?>

<h2><?= $mode . " BAHAN BAKU" ?></h2>

<form method="post" action="<?= base_url()."index.php/pantry/save_bahan_baku" ?>">
	<input type="hidden" name="mode" value="<?= $mode ?>" />
	<?php if($mode == 'EDIT'){ ?>
		<input type="hidden" name="id_bahan_baku" value="<?= $detail['id_bahan_baku'] ?>" />
	<?php } ?>
	
	<table cellpadding="10">
		<tr>
			<td>Nama</td>
			<td><input name="nama" size="50" value="<?=($mode == 'EDIT' ? $detail['nama'] : '')?>" /></td>
		</tr>
		<tr>
			<td><?=($mode == 'ADD' ? 'Jumlah' : 'Stok')?></td>
			<td><input name="stok" size="5" value="<?=($mode == 'EDIT' ? $detail['stok'] : '')?>" /> kg</td>
		</tr>
		<?php if($mode == 'ADD'){ ?>
			<tr>
				<td>Tanggal Kadaluarsa</td>
				<td><input name="tgl_expired" size="20" placeholder="yyyy-mm-dd" /></td>
			</tr>
		<?php } ?>
		<tr>
			<td></td>
			<td>
				<a href="<?= base_url()."index.php/pantry" ?>"><input type="button" value="Kembali" /></a>
				<input type="submit" value="Simpan" />
			</td>
		</tr>
	</table>
</form>